#include <iostream>
#include <pthread.h>
#include <unistd.h>
using namespace std;
void *start_routine(void *arg)
{
    cout << "线程创建成功" << endl;
    pthread_exit(nullptr); // 线程函数终止
}
int main()
{
    pthread_t tid;
    cout << "主线程：" << getpid() << endl;
    pthread_create(&tid, nullptr, start_routine, (void *)"hello world");
    pthread_detach(tid); // 分离线程
    sleep(3);
    return 0;
}